<!DOCTYPE html>
<html>
<head>
    <title>采购商品推送记录表</title>
    <#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <el-table :data="erpGoodsPushList" style="width: 100%">
        <el-table-column
                type="index"
                width="50">
        </el-table-column>
        <el-table-column prop="createTime" label="创建时间"></el-table-column>
        <el-table-column prop="pushTitle" label="标题" show-overflow-tooltip></el-table-column>
        <el-table-column prop="pushType"
                         label="推送类型"
                         :filters="[{ text: '商品', value: 0 }, { text: '优惠券', value: 1 }]"
                         :filter-method="filterType">
            <template slot-scope="scope">
                {{scope.row.pushType == 0 ? '商品': '优惠券'}}
            </template>
        </el-table-column>
        <el-table-column prop="pushId" label="推送ID" show-overflow-tooltip></el-table-column>
        <el-table-column prop="pushWay"
                         label="推送方式"
                         :filters="[{ text: '全部用户', value: 0 }, { text: '部分用户', value: 1 }]"
                         :filter-method="filterWay">
            <template slot-scope="scope">
                {{scope.row.pushWay == 0 ? '全部用户': '指定用户'}}
            </template>
        </el-table-column>
        <el-table-column prop="pushTarget" label="推送目标" show-overflow-tooltip></el-table-column>
        <el-table-column prop="pushContent" label="内容" show-overflow-tooltip></el-table-column>
        <el-table-column align="right" label="新建通知" :render-header="renderHeaderBtn"></el-table-column>
    </el-table>

    <div style="margin-bottom: 10px;"></div>

    <div class="block" align="center">
        <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="page.currentPage"
                :page-sizes="page.pageSizes"
                :page-size="page.pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="page.total">
        </el-pagination>
    </div>

    <el-dialog title="消息通知" :visible.sync="pushFormVisible">
        <el-form :model="erpGoodsPushForm" :rules="rules" ref="erpGoodsPushForm">
            <el-form-item label="标题" label-width="120px" prop="pushTitle">
                <el-input v-model.trim="erpGoodsPushForm.pushTitle" autocomplete="off" clearable></el-input>
            </el-form-item>
            <el-form-item label="内容" label-width="120px" prop="pushContent">
                <el-input
                        type="textarea"
                        :rows="3"
                        placeholder="请输入内容"
                        v-model.trim="erpGoodsPushForm.pushContent">
                </el-input>
            </el-form-item>
            <el-form-item label="类型" label-width="120px" prop="pushType">
                <el-radio-group v-model="erpGoodsPushForm.pushType">
                    <el-radio :label="0">商品</el-radio>
                    <el-radio :label="1">优惠券</el-radio>
                </el-radio-group>
            </el-form-item>

            <el-form-item label-width="120px" prop="pushId">
                <el-input v-model.trim="erpGoodsPushForm.pushId" :placeholder="pholder" autocomplete="off"
                          clearable></el-input>
            </el-form-item>

            <el-form-item label="目标人群" label-width="120px">
                <el-radio-group v-model="erpGoodsPushForm.pushWay" @change="handlePushWayChange">
                    <el-radio :label="0">全部</el-radio>
                    <el-radio :label="1" v-show="erpGoodsPushForm.pushType==1">指定用户</el-radio>
                    <el-radio :label="2" v-show="erpGoodsPushForm.pushType==0">区域用户</el-radio>
                </el-radio-group>
                <el-select v-model="erpGoodsPushForm.quyu"  filterable clearable
                           v-show="erpGoodsPushForm.pushType==0 && erpGoodsPushForm.pushWay==2 && erpGoodsPushForm.pushWay!=0"
                        size="mini">
                    <el-option  v-for="item in options" :key="item.regionId"  :label="item.localName" :value="item.localName"></el-option>

                </el-select>
            </el-form-item>
            <el-form-item label-width="120px" v-show="erpGoodsPushForm.pushWay == 1">
                <el-table :data="userList" height="250" style="width: 100%" size="mini"
                          highlight-current-row    @current-change="handleCurrentChange">
                    <el-table-column type="index" width="55"></el-table-column>
                    <el-table-column prop="mallUserId" label="会员ID" width="120px"></el-table-column>
                    <el-table-column prop="username" label="会员名"></el-table-column>
                    <el-table-column prop="mobile" label="手机号"></el-table-column>
                    <el-table-column align="right" :render-header="renderHeaderInput"></el-table-column>
                </el-table>
                <div style="margin-top: 10px;"></div>
                <el-row>
                    已选择：
                    <Span v-show="selectUserList!=null" style="font-size: 16px;color: red">
                        {{selectUserList.mallUserId}}&nbsp;&nbsp;&nbsp;&nbsp;{{selectUserList.username}}&nbsp;&nbsp;&nbsp;&nbsp;{{selectUserList.mobile}}
                    </Span>
                  <p v-show="selectUserList==null"></p>
                </el-row>
            </el-form-item>

        </el-form>

        <div slot="footer" class="dialog-footer">
            <el-button @click="pushFormVisible = false" size="small">取 消</el-button>
            <el-button type="primary" @click="saveData" size="small">确 定</el-button>
        </div>
    </el-dialog>
</div>

<script src="${request.contextPath}/statics/js/modules/push/erpgoodspush.js?_${.now?long}"></script>
</body>
</html>